<!DOCTYPE html>
<html class="loading" lang="en" data-textdirection="">
<head>
  <script src="../js/jquery.min.js" type="text/javascript"></script>
  <script src="../js/jquery-ui-1.10.4.min.js" type="text/javascript"></script>
  <script src="../js/editHtml.js" type="text/javascript"></script>
  <script src="../js/func.js?v=1.0" type="text/javascript"></script>
  <script src="../js/jquery.serializejson.js" type="text/javascript"></script>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
  <meta name="description" content="Modern admin is super flexible, powerful, clean &amp; modern responsive bootstrap 4 admin template with unlimited possibilities with bitcoin dashboard.">
  <meta name="keywords" content="admin template, modern admin template, dashboard template, flat admin template, responsive admin template, web app, crypto dashboard, bitcoin dashboard">
  <meta name="author" content="PIXINVENT">
  <title>中国网络安全审查与认证区块链平台-忘记密码</title>
  <link rel="apple-touch-icon" href="../images/ico/apple-icon-120.png">
  <link rel="shortcut icon" type="image/x-icon" href="../images/ico/favicon.ico">
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Quicksand:300,400,500,700"
  rel="stylesheet">
  <link href="https://maxcdn.icons8.com/fonts/line-awesome/1.1/css/line-awesome.min.css"
  rel="stylesheet">
  <!-- BEGIN VENDOR CSS-->
  <link rel="stylesheet" type="text/css" href="../css/vendors.css">
  <!-- END VENDOR CSS-->
  <!-- BEGIN MODERN CSS-->
  <link rel="stylesheet" type="text/css" href="../css/app.css">
  <!-- END MODERN CSS-->
  <!-- BEGIN Page Level CSS-->
  <link rel="stylesheet" type="text/css" href="../css/core/menu/menu-types/vertical-menu.css">
  <link rel="stylesheet" type="text/css" href="../css/core/colors/palette-gradient.css">
  <!-- END Page Level CSS-->
  <!-- BEGIN Custom CSS-->
  <link rel="stylesheet" type="text/css" href="../css/style.css">
  <!-- END Custom CSS-->
</head>
<body class="vertical-layout vertical-menu 1-column   menu-expanded blank-page blank-page"
data-open="click" data-menu="vertical-menu" data-col="1-column">
  <!-- ////////////////////////////////////////////////////////////////////////////-->
  <div class="app-content content">
    <div class="content-wrapper">
      <div class="content-header row">
      </div>
      <div class="content-body">
        <section class="flexbox-container">
          <div class="col-12 d-flex align-items-center justify-content-center">
            <div class="col-md-4 col-10 box-shadow-2 p-0">
              <div class="card border-grey border-lighten-3 px-2 py-2 m-0">
                <div class="card-header border-0 pb-0">
                  <div class="card-title text-center">
                    <img src="../images/logo/logo-dark.png" alt="branding logo">
                  </div>
                  <h6 class="card-subtitle line-on-side text-muted text-center font-small-3 pt-2">
                    <span>重置密码</span>
                  </h6>
                </div>
                <div class="card-content">
                  <div class="card-body">
                    <!-- <form class="form-horizontal" action="login-simple.html" novalidate> -->
                      <fieldset class="form-group position-relative has-icon-left">
                        <input type="text" class="form-control form-control-lg input-lg" id="ID"
                        placeholder="请输入身份证号码" required>
                        <div class="form-control-position">
                          <i class="ft-user"></i>
                        </div>
                      </fieldset>
                      <fieldset class="form-group position-relative has-icon-left">
                        <input type="text" class="form-control form-control-lg input-lg" id="unitNo"
                        placeholder="请输入机构编号(营业执照编号)" required>
                        <div class="form-control-position">
                          <i class="ft-file-text"></i>
                        </div>
                      </fieldset>
                       <!-- <form class="form-horizontal" action="login-simple.html" novalidate> -->
                      <fieldset class="form-group position-relative has-icon-left">
                        <input type="password" class="form-control form-control-lg input-lg" id="newpassword"
                        placeholder="新密码" required>
                        <div class="form-control-position">
                          <i class="ft-lock"></i>
                        </div>
                      </fieldset> 
					  <!-- <form class="form-horizontal" action="login-simple.html" novalidate> -->
                      <fieldset class="form-group position-relative has-icon-left">
                        <input type="password" class="form-control form-control-lg input-lg" id="newpassword1"
                        placeholder="再次确认新密码" required>
                        <div class="form-control-position">
                          <i class="ft-lock"></i>
                        </div>
                      </fieldset>
                      <button onclick="recoverPassword()" class="btn btn-outline-info btn-lg btn-block">点击找回</button>
                    <!-- </form> -->
                  </div>
                </div>
                <div class="card-footer border-0">
                  <p class="float-sm-left text-center"><a href="login-simple.html" class="card-link">登录</a></p>
                  
                </div>
              </div>
            </div>
          </div>
        </section>
		<script>
			function recoverPassword(){
			    var idCard=$("#ID").val();
			    var institutionNumber=$("#unitNo").val();
				var newpassword=document.getElementById("newpassword").value;
				var newpassword1=document.getElementById("newpassword1").value;
				if(idCard==""||institutionNumber==""||newpassword==""||newpassword1==""){
				    alert("不能有数据为空");
				    if(idCard==""){
                        document.getElementById("ID").style.border = '#FF0000 1px solid';
                    }
                    if(institutionNumber==""){
                        document.getElementById("unitNo").style.border = '#FF0000 1px solid';
                    }
                    if(newpassword==""){
                        document.getElementById("newpassword").style.border = '#FF0000 1px solid';
                    }
                    if(newpassword1==""){
                        document.getElementById("newpassword1").style.border = '#FF0000 1px solid';
                    }
                    if(idCard!=""){
                        document.getElementById("ID").style.border = '#BABFC7 1px solid';
                    }
                    if(institutionNumber!=""){
                        document.getElementById("unitNo").style.border = '#BABFC7 1px solid';
                    }
                    if(newpassword!=""){
                        document.getElementById("newpassword").style.border = '#BABFC7 1px solid';
                    }
                    if(newpassword1!=""){
                        document.getElementById("newpassword1").style.border = '#BABFC7 1px solid';
                    }
                }
				else if(newpassword!=newpassword1){
				    alert("两次密码输入不一致");
                }
                else if(idCard.length!=18){
				    alert("身份证号格式不正确");
                    document.getElementById("ID").style.border = '#FF0000 1px solid';
                }
                else {
                    var data1 = JSON.stringify({
                        "institutionNumber": institutionNumber,
                        "idCard": idCard,
                        "password": newpassword,
                        "password1": newpassword1
                    });
                    console.log(data1);
                    $.ajax({
                        dataType: "json",
                        type: "post",
                        crossDomain: true, //new add
                        contentType: 'application/json',
                        url: "/userRecoverPassword1",
                        data: data1,
                        success: function (result) {
                            console.log(result)
                            if (result.code == 0) {
                                my_confirm("密码重置成功，请重新登录", function () {
                                    window.location = "login"
                                })
                            } else if(result.code==-1) {
                               alert("请填写正确的营业执照编号");
                            }
                            else if(result.code==-2){
                                alert("该用户不存在");
                            }
                        },
                        error: function () {

                        }
                    });
                }
			}
		</script>
      </div>
    </div>
  </div>
  <!-- ////////////////////////////////////////////////////////////////////////////-->
  <!-- BEGIN VENDOR JS-->
  <script src="../vendors/js/vendors.min.js" type="text/javascript"></script>
  <!-- BEGIN VENDOR JS-->
  <!-- BEGIN PAGE VENDOR JS-->
  <script src="../vendors/js/forms/validation/jqBootstrapValidation.js"
  type="text/javascript"></script>
  <!-- END PAGE VENDOR JS-->
  <!-- BEGIN MODERN JS-->
  <script src="../js/core/app-menu.js" type="text/javascript"></script>
  <script src="../js/core/app.js" type="text/javascript"></script>
  <!-- END MODERN JS-->
  <!-- BEGIN PAGE LEVEL JS-->
  <script src="../js/scripts/forms/form-login-register.js" type="text/javascript"></script>
  <!-- END PAGE LEVEL JS-->
  <!--<script src="../js/editHtml.js" type="text/javascript"></script>-->
</body>
</html>